#ifndef NETWORKWRAPPER_H_
#define NETWORKWRAPPER_H_

#include "SDL2/SDL_net.h"
#include <string>

class NetworkWrapper
{
public:
    static void init();
    static void quit();

    static TCPsocket openServerSocket();
    static TCPsocket openClientSocket(const std::string& serverIp);
    static void closeSocket(TCPsocket socket);

    static TCPsocket acceptConnection(TCPsocket serverSocket);
    static void receiveFrom(TCPsocket socket, void* data, size_t size);
    static void sendTo(TCPsocket socket, void* data, size_t size);

private:
    NetworkWrapper();
    virtual ~NetworkWrapper();
    static TCPsocket openSocket(const char* hostIp);
    static void checkSocket(TCPsocket socket);
};

#endif
